<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<link href="../css/estilos.css" rel="stylesheet" type="text/css" />
<%@ page import="java.util.*" %>
<%@ page import="beans.*" %>
<jsp:useBean id="listaMaterias" scope="request" class="databeans.MateriaDataBean" />
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script language="javascript" type="text/javascript"src="../js/utilidades.js"></script>
        <title>EME:Agregar Alumno</title>
    </head>
    <body >
        <sec:authorize ifAnyGranted="ROLE_SYSTEM">

        <table  border="0" width="100%">
            <thead>
                <tr>
                    <th >
                        <h1><img src="../images/EME2.png" width="175px"></h1>
                    </th>
                    <th >
                        <h1><img src="../images/headers/agregarAlumno.png"></h1>
                    </th>

                </tr>
            </thead>
            <tbody>

                <tr>
                    <td width="200px" valign="top">
                        <div>
                            <jsp:include page="menu.jsp"/>
                        </div>

                    </td>
                    <td><center>

                        <FORM name="form1"
                             ACTION="../addAlumno"
                             METHOD="POST"
                             onsubmit="return validaForm(this)">
                               <center>
                                   <table class="tabla2" border="0" style="border-color:transparent">
                                   <tbody>
                                  
                                       <tr>
                                           <td>
                                               Carnet:
                                           </td>
                                            <td>
                                                <input name="carnet"
                                                       size="10"
                                                       maxlength="7"
                                                       onKeyUp="this.value=this.value.toUpperCase();">
                                           </td>
                                       </tr>
                                       <tr>
                                           <td>
                                               Nombre:
                                           </td>
                                           <td>
                                               <input name="nombres"
                                                      size="40"
                                                      maxlength="60"   >
                                           </td>
                                       </tr>                                
                                       <tr>
                                           <td>
                                               G&eacute;nero:
                                           </td>
                                           <td>
                                               <INPUT TYPE="RADIO" NAME="sexo" VALUE="M" checked="true">
                                               Masculino
                                               <INPUT TYPE="RADIO" NAME="sexo" VALUE="F">
                                               Femenino
                                           </td>
                                       </tr>
                                     
                                       <tr>
                                           <td>
                                               e-Mail:
                                           </td>
                                           <td>
                                              <input name="email"
                                                     size="50"
                                                     maxlength="50"
                                                     onchange="validarEmail(this)">
                                           </td>
                                       </tr>
                                        <tr>
                                           <td>
                                               Telefono celular:
                                           </td>
                                           <td>
                                              <input name="telefono" 
                                                     size="10"
                                                     maxlength="8"
                                                     onchange="validarCel(this)">
                                           </td>
                                       </tr>
                                       <tr>
                                           <td style="vertical-align:top">Materias:</td>
                                           <td>

                                               
                                               
                                                <%
                                                List listaMat = listaMaterias.getMateriasCicloActual();
                                                Iterator it = listaMat.iterator();
                                                int i=0;
                                                while (it.hasNext()){
                                                    MateriaBean materia = (MateriaBean)it.next();
                                               
                                                %>
                                                <input name="materias" type="checkbox" value="<%= materia.getCodMateria()%>">
                                                    <%= materia.getNomMateria()%>
                                               <br>
                                                <%
                                                }
                                                %>
                                                
                                           </td>
                                       </tr>
                                       <tr>
                                           <td colspan="2">
                                               <center>
                                               <INPUT TYPE="SUBMIT" VALUE="Aceptar" >
                                               <input type="button" value="Cancelar">
                                                </center>
                                           </td>
                                       </tr>
                                   </tbody>
                               </table>
                            </center>
                    </FORM>
                        </center>
                    </td>
                </tr>
            </tbody>
        </table>
        <div align="left">
        <jsp:include page="barrausuario.jsp"/>
        </div>
        </sec:authorize>
    </body>
    
</html>
